import {createRouter, createWebHashHistory,RouteRecordRaw} from "vue-router";

import NotFound from '../views/NotFound.vue';
import PageHead from '../components/PageHead.vue';
import PageFooter from '../components/PageFooter.vue';
import Home from '../views/Home.vue';
import BusinessList from '../views/BusinessList.vue';
import Business from '../views/Business.vue';
import ConfirmOrder from '../views/ConfirmOrder.vue';
import Payment from '../views/Payment.vue';
import Login from '../views/Login.vue';
import Enroll from '../views/Register.vue';
import OrderHistory from '../views/OrderHistory.vue';
import addAddress from '../views/addAddewss.vue';
import AddressList from '../views/AddressList.vue';
import modifyAddress from '../views/modifyAddress.vue';
import MyView from '../views/MyView.vue'
const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect:'/login'
    },
    {
        path: '/login',
        components:{
            PageBody:Login,
            PageHead:PageHead,
            PageFooter:PageFooter
        }
    },
    {
        path: '/home',
        components:{
            PageHead:PageHead,
            PageBody:Home,
            PageFooter:PageFooter
        }
    },
    {
        path: '/businessList',
        components:{
            PageBody:BusinessList,
            PageHead:PageHead,
            PageFooter:PageFooter
        }
    },
    {
        path: '/business',
        components:{
            PageBody:Business,
            PageHead:PageHead,
            PageFooter:PageFooter
        }
    },
    {
        path: '/confirmOrder',
        components:{
            PageBody:ConfirmOrder,
            PageHead:PageHead,
            PageFooter:PageFooter
        }
    },
    {
        path: '/payment',
        components:{
            PageBody:Payment,
            PageHead:PageHead,
            PageFooter:PageFooter
        }
    },
    {
        path: '/enroll',
        components:{
            PageBody:Enroll,
            PageHead:PageHead,
            PageFooter:PageFooter
        }
    },
    {
        path: '/orderHistory',
        components:{
            PageBody:OrderHistory,
            PageHead:PageHead,
            PageFooter:PageFooter
        }
    },
    {
        path: '/addAddress',
        components:{
            PageBody:addAddress,
            PageHead:PageHead,
            PageFooter:PageFooter
        }
    },
    {
        path: '/addressList',
        components:{
            PageBody:AddressList,
            PageHead:PageHead,
            PageFooter:PageFooter
        }
    },
    {
        path: '/modifyAddress',
        components:{
            PageBody:modifyAddress,
            PageHead:PageHead,
            PageFooter:PageFooter
        }
    },
    {
        path: '/:path(.*)',
        component: NotFound
    },
    {
        path: '/mine',
        components:{
            PageHead:PageHead,
            PageBody:MyView,
            PageFooter:PageFooter
        }
    },
]
const router = createRouter({
    history: createWebHashHistory(),
    routes,
})
export default router